import request from "../request";

//管理员登录
const Login = async (params: any) => {
    return await request.post<string>('/api/manager/login', JSON.stringify(params))
}

//查询管理员
const getmanager = async (page: number, managerName: string) => {
    return await request.get('/api/manager/getManager?page=' + page + '&managerName=' + managerName, { showLoading: false })
}

//新增管理员
const newManager = async(params:any) => {
    return await request.post('/api/manager/newManager',JSON.stringify(params),{showLoading:true})
}

//修改管理员状态
const changgeStatus = async(params:any) => {
    return await request.post('/api/manager/editStatus',JSON.stringify(params),{showLoading:true})
}

//删除管理员
const delAdmin = async (params:any) => {
    return await request.post('/api/manager/delManager',JSON.stringify(params),{showLoading:true})
}

export {
    newManager,
    getmanager,
    Login,
    changgeStatus,
    delAdmin
}